package cn.wangsy.zhidao.p20170112;

public class Sum {

	public static void main(String[] args) {

		int[]a = {2,5,3,9,12,7};
		int sum = f(a, a.length-1);
		System.out.println(sum);
		
	}

	public static int f(int[]a,int end){
		if(end == -1) return 0;
		return a[end] + f(a, end-1);
	}
	
}
